home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / G-Games / (c)gb.d64 / blackjack 1.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  5KB  |  134 lines

  1. 40 REM ********************************
  2. 50 REM * ALTERED SLIGHTLY AT 0328H ON *
  3. 60 REM *    APRIL THE 2ND, 1985 BY    *
  4. 70 REM *         DAVID BRADLEY        *
  5. 80 REM ********************************
  6. 100 DIMC(51),P$(12),V(12),S$(3),Y(5),M(5),B$(4),K$(5)
  7. 105 PRINTCHR$(142):PRINTCHR$(8):POKE53280,0:POKE53281,0:PRINT""
  8. 110 F$="[213][192][192][192][201][157][221][157][221][157][221][157][221][157][221][157][203][157][157][192][157][157][192][157][157][192][157][157][202][157][145][221][157][145][221][157][145][221][157][145][221][157][145][221]"
  9. 120 DATA"A  ","   "," X ","   ","  A"
  10. 130 DATA"2  "," X ","   "," X ","  2"
  11. 140 DATA"3  "," X "," X "," X ","  3"
  12. 150 DATA"4  ","X X","   ","X X","  4"
  13. 160 DATA"5  ","X X"," X ","X X","  5"
  14. 170 DATA"6  ","X X","X X","X X","  6"
  15. 180 DATA"7  ","X X","XXX","X X","  7"
  16. 190 DATA"8  ","XXX","X X","XXX","  8"
  17. 200 DATA"9 X","X X","XXX","X X","X 9"
  18. 210 DATA"10X","XXX","X X","XXX","X10"
  19. 220 DATA"J X","A  ","C  ","K  ","X J"
  20. 230 DATA"Q X","U  ","E  ","E  ","N Q"
  21. 240 DATA"K X","I  ","N  ","G  ","X K"
  22. 250 FORJ=0TO12:READP$(J):FORK=0TO3:READP$:P$(J)=P$(J)+"[157][157][157]"+P$:NEXTK
  23. 260 P$(J)=P$(J)+"[145][145][145][145][145]":NEXTJ
  24. 270 DATA "[193]","[216]","[211]","[218]"
  25. 280 FORJ=0TO3:READS$(J):NEXTJ
  26. 290 DATA 1,2,3,4,5,6,7,8,9,10,10,10,10
  27. 300 FORJ=0TO12:READV(J):NEXTJ
  28. 310 V$=""
  29. 320 H$=""
  30. 330 N$="   [157][157][157]   [157][157][157]   [157][157][157]   [157][157][157]   "
  31. 340 DATA "I'LL HAVE ONE,TOO","THAT CALLS FOR A DRINK","MAYBE I'LL HAVE ANOTHER"
  32. 350 DATA "I'LL JUST HAVE A SNORT HERE","ANOTHER LI'L DRINK"
  33. 360 FORJ=0TO4:READB$(J):NEXTJ
  34. 370 DATA "",", FRIEND",", PAL",", BUDDY",", OLD BUDDY"
  35. 380 FORJ=1TO5:READK$(J):NEXTJ
  36. 390 T=TI
  37. 400 X=RND(-T):T=T/1000:IFT>=1GOTO400
  38. 410 PRINT"[147] BUTTERFIELD SOCIAL & RECREATIONAL CLUB"
  39. 420 INPUT"HOW MUCH MONEY DO YOU HAVE";F
  40. 430 IFF<100THENPRINT"SCRAM, CHEAPSKATE!":END
  41. 440 M1=1:K$="#"
  42. 450 M1=M1*10:IFF/M1>50GOTO450
  43. 460 F1=INT(10*RND(1)+12)*M1
  44. 470 IFF1<FTHENPRINT"MEMBERSHIP FEES ARE $";F-F1:F=F1
  45. 480 PRINT"MINIMUM BET IS $";M1:F1=F
  46. 490 PRINT"DRINKS ARE ON THE HOUSE--":PRINT"POUR YOURSELF ONE WHILE I SHUFFLE."
  47. 500 IFRND(1)*5<D1*D2GOTO1100
  48. 510 IFD1=5GOTO1020
  49. 520 PRINTB$(D1):PRINT"SHUFFLING..":D1=D1+1
  50. 530 FORJ=0TO51:C(J)=J:NEXTJ
  51. 540 FORJ=0TO51:S=INT(RND(1)*52):S1=C(J):C(J)=C(S):C(S)=S1:NEXTJ:D=51
  52. 550 IFD<9GOTO500
  53. 560 IFF<M1GOTO1190
  54. 570 IFASC(K$)<>33ANDRND(1)>.7THENREADK$:PRINTK$
  55. 575 PRINT"YOU HAVE $";F;":YOUR BET";K$(D1);:INPUTB:IFB>FGOTO570
  56. 580 IFB=0GOTO1200
  57. 590 IFB<M1THENPRINT"MINIMUM BET IS $";M1;:GOTO570
  58. 600 PRINT"[147]":M=0:Y=0:GOSUB850:GOSUB860:GOSUB940:GOSUB840:GOSUB860:GOSUB940
  59. 610 GOSUB850:GOSUB860:C$=N$:GOSUB940
  60. 620 GOSUB840:GOSUB860:GOSUB940
  61. 630 A=0:T=0:FORJ=1TOY:C=Y(J):GOSUB860:NEXTJ
  62. 640 T1=T+A:IFT1>21THENT1=T
  63. 650 PRINT"                                     "
  64. 660 PRINT"YOUR TOTAL=";T1;"[157] ";
  65. 670 IFT1>21THENPRINT"*BUSTED*":GOTO830
  66. 680 IFY=5THENPRINT"*5-CARD WIN*":GOTO810
  67. 690 INPUT"..HIT OR STAND";Z$
  68. 700 IFASC(Z$)<83THENGOSUB840:GOSUB860:GOSUB940:GOTO640
  69. 710 A=0:T=0:X1=9:FORX=1TOM:C=M(X):GOSUB860:NEXTX:GOSUB940
  70. 720 T2=T+A:IFT2>21THENT2=T
  71. 730 PRINTLEFT$(V$,17);"MY TOTAL=";T2;"[157] ";
  72. 740 IFT2>21THENPRINT"*BUSTED*":GOTO810
  73. 750 IFM=5THENPRINT"*5-CARD WIN*":GOTO830
  74. 760 IFT>15ORT2>17GOTO780
  75. 770 GOSUB850:GOSUB860:GOSUB940:GOTO720
  76. 780 IFT2>T1GOTO830
  77. 790 IFT1>T2GOTO810
  78. 800 PRINTV$;" NO WIN ":GOTO550
  79. 810 PRINTV$;" YOU WIN ":F=F+B:W1=W1+1:IFW1=3GOTO950
  80. 820 GOTO550
  81. 830 PRINTV$;"I WIN":F=F-B:W1=W2:GOTO550
  82. 840 Y=Y+1:X=Y:X1=2:C=C(D):D=D-1:Y(Y)=C:RETURN
  83. 850 M=M+1:X=M:X1=9:C=C(D):D=D-1:M(M)=C:RETURN
  84. 860 V=INT(C/4):S=C-V*4:S$=S$(S)
  85. 870 P$=P$(V):C$="":FORK=1TOLEN(P$)
  86. 880 M$=MID$(P$,K,1):IFM$="X"THENM$=S$
  87. 890 C$=C$+M$:NEXTK:T=T+V(V):IFV=0THENA=10
  88. 900 H=INT(X*5+RND(1)*D1-D1/2+.5):V1=X1+INT(RND(1)*D1-D1/2+.5)
  89. 910 IFX=2THENH=10:V1=X1
  90. 920 IFV1<2THENV1=2
  91. 930 RETURN
  92. 940 PRINTLEFT$(V$,V1);LEFT$(H$,H);F$;C$:RETURN
  93. 950 PRINT"[211]HI..MY NAME IS TOOTS[211]"
  94. 960 PRINT"[211]SURE LIKE YOUR STYLE[211]"
  95. 970 PRINT"[211]COULDN'T HELP NOTICING YOUR FLASHY[211]"
  96. 980 PRINT"[211]PLAYING AND YOUR BIG WALLET[211]"
  97. 990 PRINT"[211]MAYBE WE CAN GET TOGETHER LATER[211]"
  98. 1000 PRINT"[211]I'LL BE OVER BY THE CASHIER[211]"
  99. 1010 W2=4:GOTO550
  100. 1020 FORJ=1TO1E3:NEXT:PRINT"[147]LESH HAVE NUTHER DRINK WHILE I SHUFFLE"
  101. 1030 FORJ=1TO20:PRINTLEFT$(V$,4+RND(1)*15);LEFT$(H$,RND(1)*30+1);F$;N$:NEXTJ
  102. 1040 PRINTV$;"SHORRY, I DROPPED THE CARDS..":FORJ=1TO2000:NEXTJ
  103. 1050 PRINT"    ANNOUNCEMENT "
  104. 1060 PRINT"THE MANAGEMENT REGRETS THE DEALER"
  105. 1070 PRINT"HAVING SLID UNDER YOUR TABLE"
  106. 1080 PRINT"A NEW DEALER WILL REPLACE HIM."
  107. 1090 D1=0:D2=1:GOTO500
  108. 1100 FORJ=1TO1E3:NEXT:PRINT"[147]*OPEN UP - THIS IS THE POLICE*"
  109. 1110 PRINT"WHAT?":PRINT"*YOU GOT A LICENSE FOR GAMBLING*"
  110. 1120 PRINT"UH..":PRINT"*OK, YOU BETTER COME ALONG*"
  111. 1130 PRINT"BUT..":PRINT"*THIS YOUR MONEY?  IT'S EVIDENCE*"
  112. 1140 PRINT"WELL..":PRINT"*OKAY,THAT'S IT .. EVERYBODY OUT"
  113. 1150 PRINT"*BUDDY, LET ME GIVE YOU SOME ADVICE*"
  114. 1160 PRINT"*NEVER GAMBLE ..":PRINT"*ESPECIALLY IN A JOINT LIKE THIS.*"
  115. 1170 PRINT"BEFORE THE RAID, YOU HAD $";F:PRINT"NOW YOU HAVE $0."
  116. 1180 PRINT"HAVE A NICE WALK HOME":END
  117. 1190 PRINT"BEAT IT - WE DON'T ALLOW DEADBEATS HERE"
  118. 1200 IFF>F1THENPRINT"YOU GAINED $";F-F1
  119. 1210 IFF<F1THENPRINT"YOU LOST $";F1-F
  120. 1220 IFF=F1THENPRINT"YOU BROKE EVEN!"
  121. 1230 PRINT"..AND LEFT WITH $";F
  122. 1240 DATA "I USED TO WORK IN VEGAS, YOU KNOW"
  123. 1250 DATA "WHAT A CRUMMY JOINT THIS IS."
  124. 1260 DATA "BOY, WE GET WEIRD CUSTOMERS HERE."
  125. 1270 DATA "A BUNCH OF CHEAPSKATES RUN THIS DUMP."
  126. 1280 DATA "THE ROULETTE WHEEL IS MORE FUN."
  127. 1290 DATA "FOOD HERE IS LOUSY."
  128. 1300 DATA "I GET SICK OF LOOKING AT THESE CARDS."
  129. 1310 DATA "MY BOSS IS A MEAN OLD CRAB."
  130. 1320 DATA "MAYBE I SHOULD WORK AT THE RACES."
  131. 1330 DATA "THIS IS A LOUSY JOB, YOU KNOW."
  132. 1340 DATA "BIG DEAL; LAS VEGAS WITH PEELING PAINT"
  133. 1350 DATA "!IF MY MOTHER KNEW I WORKED HERE..."
  134.